home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / READMEFiles / TarChive.README < prev    next >
Text File  |  1992-08-29  |  8KB  |  132 lines

  1. Copyright 1992    Sherwood Botsford
  2.  
  3.  
  4.                     Welcome to TarChive 0.7
  5.  
  6. This is a command line method of maintaining your sanity when dealing with tapes.  The TarChive package is a set of Perl scripts, and two binary files that together make a sensible way to deal with tapes.
  7.  
  8. This is a preliminary release. (escape?)  Use with the due caution for any beta software.  I appreciate bugs reports, suggestions, etc.
  9.  
  10. Tapes have several drawbacks as means of storing information.
  11.     They're slow.
  12.     You have to read the whole tape to find out what's on it.
  13.     You often aren't quite sure if what you think is there is really there.
  14.     You have little protection from someone else writing on the tape if you leave it in the drive.
  15.     If you have serveral tapes they are difficult for programs to tell apart. (Generally you have to go look at the label.)
  16.     If there is a glitch in the tape, you've usually lost the rest of the archive.
  17.     
  18. TarChive has partial solutions to most of the problems above.
  19.  
  20.     Speed:    TarChive encourages creating archives in the 20-100 MB range.  Because of this you can use the much faster file positioning commands (10-100 times faster than reading the tape).
  21.     
  22.     Directories:  TarChive keeps log files of whatever it puts on tape.  So later, a single grep command will tell you that file x is in the 11th archive on tape Y.
  23.     
  24.     Verification:  TarChive writes an archive to tape, then reads it back and compares it to the original.
  25.     
  26.     Tape Labeling:  TarChive will not write on a tape that is not labeled. TarChive will not write on a tape not owned by the user.  TarChive will not write on a tape that is not registered on the system.  All log files refer to the tape label so that you can easily determine what is on each tape.
  27.  
  28.     Error recovery:  TarChive uses gnutar as it's tarring command.  If gnutar can't read a part of the tape, it moves on to the next file header within the archive, and carries on from there.  Losses are minimized.
  29.     
  30.     Driver glitches:  On occasion Next's tape driver decides to reset the tape. TarChive keeps track of what tapefile is being written, and when a reset occures, repositions the tape to the correct tar file, and carries on.
  31.     
  32. Prerequisites:
  33.     In addition to this package, you need gnutar 1.10 and perl 4.010
  34.     
  35. Manifest:
  36.  
  37. mtsense    & mtsense.c    
  38.     A hack to find out what the drive is doing, and to set it's block size and mode. Credits are in the source.
  39.  
  40. TapeLibrary.perl
  41.     This is the guts of TarChive.  A set of routines that perform various tape operations.
  42.     
  43. TapeLabel
  44.     A perl script to write a label on a tape and register that label on the host machine.  TapeLabel checks for an existing label in the register, and checks for a label or data on the tape itself.
  45.     
  46. TapeErase
  47.     A perl script to remove a label from tape.  The user must specify the label to be erased.  This is checked in the register to see that the tape is registered.  The user is not permitted to erase the tape unless he owns it, and the label given on the command line matches the one on the tape.  Under these circumstances the label is unregistered, log files are deleted, and a new End of Data mark put at the beginning of the tape.
  48.     
  49. UserBack
  50.     A perl script that takes a list of directories as arguements, and creates a tar file on tape for each directory.  UserBack is smart enough to count how many files are already on the tape, and move the tape appropriatly.  Log files are put in users ~/backups.
  51.     
  52. FullUserBack
  53.     A perl script that pulls the list of users out of either netinfo or yellow pages, and creates a tar file for each user.  The log file is put in the users ~/backups directory.
  54.  
  55. FUBcron
  56.     A csh script suitable for running from your crontab file.  FUBcron
  57. runs FullUserBack and mails the results to root.
  58.     
  59. Installation:
  60.     Create a directory for tape labels.  I suggest /usr/local/tapelabels.  This directory should be mounted where all machines that have a tape drive can read it.  The directory should be owned by root, but have permissions rwxrwxrwt.
  61.     mkdir /usr/local/tapelabels
  62.     chmod a+rwx,+t /usr/local/tapelabels
  63.     This allows users to label and erase their own tapes, but not others.
  64.     
  65.     Copy TapeLibrary.perl to wherever you keep perl libraries.  /usr/local/lib/perl by default.
  66.     Copy TapeErase TapeLabel UserBack to a place on user's paths.
  67. usually /usr/local/bin or /usr/local/scripts
  68.  
  69.     
  70.     Edit TapeLibrary.perl, and customize as appropriate.  (Look for the word customize) You will at least have to tell it which hosts have exabyte drives.
  71.     
  72.     Edit FullUserBack and customize as appropriate.
  73.     You will have to tell it what filesystems have users on them.
  74.     
  75.     Put mtsense in a directory with general access.  /usr/local/bin
  76.  
  77. Overview: Theory of operation:
  78.     When a tape is registered, a zero length file is created in /usr/local/tapelables.  This file is owned by whoever ran TapeLabel, and is later used to determine who owns the tape. The name of this file is the name of the tape.  The user must own the tape in order to write to it. 
  79.     This zero length file is placed as a tar file at the beginning of the tape, and is read before any operations are done to the tape.
  80.  
  81.     Each user has a backups subdirectory under his home directory. FullUserBack creates one if necessary, UserBack will fuss if it doesn't exist.  This directory is normally owned by root so that users cannot erase files from it. They should be able to read it.  You may wish to allow users to edit the files.
  82.  
  83.     When material is backed up it is always done from the parent directory of the one requested.  This way, on a restore, it is always restored to a single subdirectory underneath the directory where the restore was run.  E.g. If I ask for a backup of ~/myprojects/TarChive it is stored as ./TarChive...  Later if I restore it, while in ~/proj, it will be restored as ~/proj/TarChive...
  84.      
  85.  
  86.     When material is verified, the log of the verification pass is put into the users backups directory.  The log file name is of the form:
  87.     TapeLabel-directory-date.  
  88.     Inside, the header of the file looks like this:
  89.  
  90. Full User  Backup: File 35 on Tape Gimel-DAT
  91. Directory:          /u/fenris/sherwood
  92. Directory stored as ./sherwood
  93. Date of backup:     Tue Aug 18 13:56:39 MDT 1992
  94. Archive size:       210310    /u/fenris/sherwood
  95. This file will be deleted when tape is erased.
  96. Gimel-DAT-sherwood-18-Aug-92 Volume 1
  97. sherwood/
  98. sherwood/.Active.datebk
  99. ...
  100.     This header is useful when you have to recover information from the tape.
  101.     
  102.     Potentially there is a problem with the nameing convention used.  If a user creates two backups of the directories with the same basename on the same tape on the same day their log files will have the same name.  This causes the match between log files and files on tape to be lost.  Example: ~/myprojects/TarChive/C-source and ~/myprojects/LaBrea/C-source both have base names of C-source.  If I made backups on the same day on the same tape they would both have log file names of Sherwood_Data-C-Source-19Aug92.  At present UserBack doesn't check for this.
  103.  
  104.     The filenumber in the header is actually off by 1, as it doesn't count the tapelabel, which is really just a file.  However, it's convenient this way, because it is the number of fsf's you need to do to get to the start of this file.
  105.     
  106.     At present there is no set of recovery scripts.  If I wished to recover data from the file above, I would do this:
  107.     
  108. setenv TAPE /dev/nrst0
  109. mt fsf 35
  110. gnutar -xvb 16 "filespec1 filespec2 filespec3..."
  111.  
  112. The v gives me a verbose list, and mentions the volume name of the archive.  b 16 is block to sixteen 512 byte blocks per tape block.  (Gnutar doesn't always pick this up when reading DAT drives.)  
  113. The filespec's can be wildcards.  Remember however anything that matches a directory recovers the entire directory subtree.
  114.  
  115. Note:  I've had troubles on occasion with large fsf's on exabyte drives.  Seems that the driver times out waiting for the drive to say, "I'm done".  If this is a problem, break it up in to smaller chunks.  The tapelibrary does them 1 at a time in a loop to avoid this.
  116.  
  117.  
  118. These routines were originally written for an exabyte 8200, then ported to and HP-DAT. (minimal changes) I have not tried this with a QIC drive yet.
  119.  
  120.  
  121. Send comments, bugs, flames, etc to
  122. sherwood@space.ualberta.ca
  123.  
  124.  
  125. require "Disclaimer.perl"
  126.  
  127. I do not guarantee that this works.
  128. I do not accept responsiblity for anything it does to your system.
  129. I do use it myself. 
  130.  
  131.      
  132.